package com.tech.zhidengxian;

import com.google.gson.annotations.SerializedName;

import org.json.JSONArray;

import java.util.List;
import java.util.Objects;

/***
 * 多轮对话  实体类
 * create  pluto
 */
public class AsrFormBean<T, Y> {
    @SerializedName("form")
    private AsrNplFormBean<T, Y> form;
    @SerializedName("entity")
    private AsrEntityBean entity;
    @SerializedName("question")
    private AsrQuestionBean question;



    public AsrEntityBean getEntity() {
        return entity;
    }

    public void setEntity(AsrEntityBean entity) {
        this.entity = entity;
    }

    public AsrQuestionBean getQuestion() {
        return question;
    }

    public void setQuestion(AsrQuestionBean question) {
        this.question = question;
    }

    public AsrNplFormBean<T, Y> getForm() {
        return form;
    }

    public void setForm(AsrNplFormBean<T, Y> form) {
        this.form = form;
    }


    public void setFrom(AsrNplFormBean<T, Y> from) {
        this.form = from;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AsrFormBean<?, ?> that = (AsrFormBean<?, ?>) o;
        return Objects.equals(form, that.form) && Objects.equals(entity, that.entity) && Objects.equals(question, that.question);
    }

    @Override
    public int hashCode() {
        return Objects.hash(form, entity, question);
    }

    @Override
    public String toString() {
        return "AsrFormBean{" +
                "form=" + form +
                ", entity=" + entity +
                ", question=" + question +
                '}';
    }

    public static class AsrQuestionBean {
        @SerializedName("id")
        private int id;
        @SerializedName("text")
        private String text;
        @SerializedName("answer")
        private AsrAnswer answer;
        @SerializedName("similar")
        private List<String> similar;


        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public AsrAnswer getAnswer() {
            return answer;
        }

        public void setAnswer(AsrAnswer answer) {
            this.answer = answer;
        }


        public List<String> getSimilar() {
            return similar;
        }

        public void setSimilar(List<String> similar) {
            this.similar = similar;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            AsrQuestionBean that = (AsrQuestionBean) o;
            return id == that.id && Objects.equals(text, that.text) && Objects.equals(answer, that.answer) && Objects.equals(similar, that.similar);
        }

        @Override
        public int hashCode() {
            return Objects.hash(id, text, answer, similar);
        }

        @Override
        public String toString() {
            return "AsrQuestionBean{" +
                    "id=" + id +
                    ", text='" + text + '\'' +
                    ", answer=" + answer +
                    ", similar=" + similar +
                    '}';
        }

        public static class AsrAnswer {
            @SerializedName("answer_type")
            private int answer_type;
            @SerializedName("voice_content")
            private String voice_content;
            private int status;//暂不发布状态  用于后台确认为暂不发布状态则使用该为判断逻辑
            @SerializedName("show_contents")
            private List<String> show_contents;

            public int getAnswer_type() {
                return answer_type;
            }

            public int getStatus() {
                return status;
            }

            public void setStatus(int status) {
                this.status = status;
            }

            public void setAnswer_type(int answer_type) {
                this.answer_type = answer_type;
            }

            public String getVoice_content() {
                return voice_content;
            }

            public void setVoice_content(String voice_content) {
                this.voice_content = voice_content;
            }

            public List<String> getShow_contents() {
                return show_contents;
            }

            public void setShow_contents(List<String> show_contents) {
                this.show_contents = show_contents;
            }


            @Override
            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                AsrAnswer asrAnswer = (AsrAnswer) o;
                return answer_type == asrAnswer.answer_type && status == asrAnswer.status && Objects.equals(voice_content, asrAnswer.voice_content) && Objects.equals(show_contents, asrAnswer.show_contents);
            }

            @Override
            public int hashCode() {
                return Objects.hash(answer_type, voice_content, status, show_contents);
            }

            @Override
            public String toString() {
                return "AsrAnswer{" +
                        "answer_type=" + answer_type +
                        ", voice_content='" + voice_content + '\'' +
                        ", status=" + status +
                        ", show_contents=" + show_contents +
                        '}';
            }
        }

    }


    public static class AsrEntityBean {
        @SerializedName("id")
        private int id;
        @SerializedName("text")
        private String text;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }


        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            AsrEntityBean that = (AsrEntityBean) o;
            return id == that.id && Objects.equals(text, that.text);
        }

        @Override
        public int hashCode() {
            return Objects.hash(id, text);
        }

        @Override
        public String toString() {
            return "AsrEntityBean{" +
                    "id=" + id +
                    ", text='" + text + '\'' +
                    '}';
        }
    }


    public static class AsrNplFormBean<T, Y> {
        @SerializedName("id")
        private int id;
        @SerializedName("uuid")
        private String uuid;
        @SerializedName("times")
        private int times;
        @SerializedName("text")
        private String text;
        @SerializedName("slots")
        private List<T> slots;
        @SerializedName("clarify")
        private Y clarify;
        @SerializedName("complete")
        private boolean complete;
        private int status;
        @SerializedName("answer")
        private AsrQuestionBean.AsrAnswer answer;
        @SerializedName("similar")
        private List<String> similar;

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getUuid() {
            return uuid;
        }

        public void setUuid(String uuid) {
            this.uuid = uuid;
        }

        public int getTimes() {
            return times;
        }

        public void setTimes(int times) {
            this.times = times;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public List<T> getSlot() {
            return slots;
        }

        public void setSlot(List<T> slot) {
            this.slots = slot;
        }

        public Y getClarify() {
            return clarify;
        }

        public void setClarify(Y clarify) {
            this.clarify = clarify;
        }

        public boolean isComplete() {
            return complete;
        }

        public void setComplete(boolean complete) {
            this.complete = complete;
        }

        public AsrQuestionBean.AsrAnswer getAnswer() {
            return answer;
        }

        public void setAnswer(AsrQuestionBean.AsrAnswer answer) {
            this.answer = answer;
        }

        public List<T> getSlots() {
            return slots;
        }

        public void setSlots(List<T> slots) {
            this.slots = slots;
        }

        public List<String> getSimilar() {
            return similar;
        }

        public void setSimilar(List<String> similar) {
            this.similar = similar;
        }

        @Override
        public String toString() {
            return "AsrNplFormBean{" +
                    "id=" + id +
                    ", uuid='" + uuid + '\'' +
                    ", times=" + times +
                    ", text='" + text + '\'' +
                    ", slots=" + slots +
                    ", clarify=" + clarify +
                    ", complete=" + complete +
                    ", status=" + status +
                    ", answer=" + answer +
                    ", similar=" + similar +
                    '}';
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            AsrNplFormBean<?, ?> that = (AsrNplFormBean<?, ?>) o;
            return id == that.id && times == that.times && complete == that.complete && status == that.status && Objects.equals(uuid, that.uuid) && Objects.equals(text, that.text) && Objects.equals(slots, that.slots) && Objects.equals(clarify, that.clarify) && Objects.equals(answer, that.answer) && Objects.equals(similar, that.similar);
        }

        @Override
        public int hashCode() {
            return Objects.hash(id, uuid, times, text, slots, clarify, complete, status, answer, similar);
        }
    }



}
